home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / src / colors.h < prev    next >
Encoding:
Text File  |  1996-11-24  |  2.4 KB  |  64 lines

  1. /*    File name    :    colors.h
  2.  *  Version        :    2.0
  3.  *
  4.  *  Header file for display driver for Mesa 2.0  under 
  5.  *    Windows95, WindowsNT and Win32
  6.  *    This file defines macros and global variables  needed
  7.  *    for converting color format
  8.  *
  9.  *    Copyright (C) 1996-  Li Wei
  10.  *  Address        :        Institute of Artificial Intelligence
  11.  *                :            & Robotics
  12.  *                :        Xi'an Jiaotong University
  13.  *  Email        :        liwei@aiar.xjtu.edu.cn
  14.  *  Web page    :        http://sun.aiar.xjtu.edu.cn
  15.  *
  16.  *  This file and its associations are partially based on the 
  17.  *  Windows NT driver for Mesa, written by Mark Leaming
  18.  *  (mark@rsinc.com).
  19.  */
  20.  
  21. /*
  22.  * $Log: colors.h,v $
  23.  * Revision 2.0  1996/11/15 10:55:00  CST by Li Wei(liwei@aiar.xjtu.edu.cn)
  24.  * Initial revision
  25.  */
  26.  
  27. char ColorMap16[] = {
  28. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  29. 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
  30. 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
  31. 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
  32. 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
  33. 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,
  34. 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,
  35. 0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
  36. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  37. 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,
  38. 0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,
  39. 0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,
  40. 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
  41. 0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,
  42. 0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,
  43. 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
  44. 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
  45. 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
  46. 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
  47. 0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
  48. 0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,
  49. 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
  50. 0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,
  51. 0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
  52. 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
  53. 0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,
  54. 0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
  55. 0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,
  56. 0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
  57. 0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,
  58. 0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,
  59. 0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
  60.  
  61.  
  62. #define BGR16(r,g,b)    ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10)))
  63. #define BGR24(r,g,b)    (((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8)
  64. #define BGR32(r,g,b)    ((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))